﻿@using Newtouch.Infrastructure;

<div id="floatInspectTemplateTree" style="display:none;">
    <div id="divInspectTempTree"></div>
</div>

<script>
    function SetCurrentPageJyjclx(jyjcmbLx) {
        if (!jyjcmbLx || jyjcmbLx == 0){
            return;
        }
        $("#divInspectTempTree").html(''); //先清空掉
        $("#divInspectTempTree").treeview({
            height: $(window).height() - 100,
            slimscroll: false,
            url: "/TemplateManage/InspectionTemplate/GetTreeList?jyjcmbLx=" + jyjcmbLx,
            onnodeclick: function (item) {
                if (item.hasChildren === true || item.value == "" || item.id == "") {
                    return;
                }
                var $grid;
                if (jyjcmbLx.toString() == '@Html.Raw(((int)EnumjyjcmbLx.jy).ToString())') {
                    $grid = $("#gridjy");
                }
                if (jyjcmbLx.toString() == '@Html.Raw(((int)EnumjyjcmbLx.jc).ToString())') {
                    $grid = $("#gridjc");
                }
                if ($grid) {
                    $grid.jqGrid('setGridParam', {
                        url: "/TemplateManage/InspectionTemplate/GetGPackageDetailByZtId",
                        postData: { ztId: item.id }
                    }).trigger("reloadGrid");
                    $grid.jqGrid("setCaption", item.text);   //重置caption属性值
                }
            }
        });
    }
</script>

